FFF digital Lab - User Guide
======================================================================
A detailed item-by-item guide (every panel, every control, shortcuts, the full
FlexBox workflow) is on the website:
    https://fffdigitallab.online/manual.html

1. The first launch will be blocked (this is normal)
----------------------------------------------------------------------
An app downloaded via WeChat / cloud drive / email is blocked by macOS the
first time: it reports that it cannot be opened because Apple cannot check
it for malicious software. Use either method below.

  [Method 1 - allow it in System Settings (recommended)]
    1. Double-click the app, then click "Done" in the dialog
    2. Open System Settings -> Privacy & Security, scroll down to the block notice
    3. Click "Open Anyway" and confirm when asked
    After that a normal double-click works.

  [Method 2 - one terminal line (for experienced users)]
    xattr -dr com.apple.quarantine "/Applications/FFF digital Lab.app"

  If it says the app is damaged and cannot be opened, use this as well -
  that command removes the download tag.

2. Where your data lives (uninstalling the app will not lose it)
----------------------------------------------------------------------
  ~/Library/Application Support/FFF digital Lab/
    presets/          your local presets
    shipped_presets/  bundled original presets (copied on first run; only fills gaps)
    last_dir.txt      last working folder
    lang.txt          UI language (zh / en)
    view_bg.txt       preview background (black / grey / white)
    save_dir.txt      default export folder

The app bundle itself is read-only; everything above lives outside of it. To back
up or move to a new Mac, copy that whole folder. "Open preset folder" opens presets/.

3. Five-minute start
----------------------------------------------------------------------
  1. "Choose folder..." on toolbar row 2 - pick the folder holding your .fff files;
     "Rescan folder" re-scans (only valid .fff: renamed TIFFs, ._x.fff and broken
     files are never listed)
  2. Click a file in the left panel; it loads in the background (progress bar on top,
     the previous preview stays so there is no black flash)
  3. Click "Restore default" to read back the preset stored in that file, or pick a
     built-in preset in the dropdown and click "Apply preset"
  4. Adjust the right panel top to bottom: Consistency -> Calibration -> Display ->
     Histogram/Levels -> Levels -> Gradation curves -> Color -> Texture. Changes
     apply instantly; there is no separate "Render" button
  5. To work on one frame, drag a rectangle (ROI) on the preview; the histogram then
     measures only that area and export outputs only it
  6. Cmd+S exports 8-bit; Cmd+Shift+S exports 16-bit (paid tier)

4. Interface at a glance
----------------------------------------------------------------------
  - Top row 1: Chinese / English, licence status, Activate..., FlexBox manager
    (paid tier and up), Holder manager
  - Top row 2: working folder (click the label to open in Finder), Choose folder...,
    Rescan folder, Open preset folder, preset dropdown, Apply preset, Restore default,
    Auto calibrate, custom preset name, Save into current fff, Save local preset
  - Top row 3: Export current preview (crop range), Output DPI, Save 8-bit / 16-bit,
    Crop single FFF, default save folder, Use current preset, Batch export 16-bit tif
  - Left panel: Select all / none / invert, thumbnail list, per-file batch checkbox
  - Centre preview: pixel (x,y) + swatch + RGB, eyedropper (black / grey / white),
    "100% view & dust brush", background (black / grey / white), rotate / mirror
  - Zoom: pinch, or hold Cmd and scroll (about 0.05x-8x)

5. Export
----------------------------------------------------------------------
  - Single: <stem>.out8.tif / <stem>.out16.tif, auto-suffixed -1 / -2... never overwritten
  - With an ROI only the ROI is exported, otherwise the whole image
  - Output DPI: optional; empty = write no DPI; legal 1-65535, an invalid value shows
    a red message and does not save
  - Default save folder: exports then land there instead of beside the source file
  - Batch export 16-bit tif (paid tier): exports the checked files as <stem>.tif;
    "Use current preset" applies the current sliders, otherwise each file own preset
  - Crop single FFF (Cmd+Option+S, commercial tier): wraps the raw device pixels inside
    the ROI plus the current preset into a complete, independently editable
    <stem>-subcrop.fff (auto-numbered)

6. Two ways to store a preset (both are safe)
----------------------------------------------------------------------
  - Save local preset: writes into the presets/ folder, never touches the .fff file.
      Best for: one set of parameters you want to apply to all files.
  - Save into current fff: writes the preset inside that .fff file, so it travels with
      the file. Best for: fixing this frame adjustments into the file itself; both this
      app and FlexColor will then list it.

  "Save into current fff" is verified interoperable with FlexColor (opens fine, lists
  the embedded preset with the right name). The write is IN-PLACE and IRREVERSIBLE:
  the app does not keep a backup - save a copy yourself before writing.

7. 100% view and dust removal
----------------------------------------------------------------------
  - Click "100% view & dust brush" on the preview toolbar, then click the preview to
    pin a spot (100 / 200 px window)
  - Dust brush (paid tier): click or drag inside the window; size 5-50 px, feather 0-1;
    an orange mask previews the stroke while dragging and the fix runs on release.
    Undo / Redo / Clear all; when happy click "Write into FFF" (irreversible - back up
    first). 1-3 px dust is only visible in the 1:1 window.

8. Keyboard shortcuts
----------------------------------------------------------------------
  Cmd+S                  Save 8-bit TIFF (ROI if set)
  Cmd+Shift+S            Save 16-bit TIFF (paid tier)
  Cmd+Option+S           Crop single FFF (commercial tier)
  Cmd+Option+A           Auto Levels
  Cmd+Option+B           Black-point eyedropper
  Cmd+Option+G           Gray-point eyedropper
  Cmd+Option+W           White-point eyedropper
  Cmd+Option+F           Append the current correction to the current FFF (same as the button)
  Cmd+R / Cmd+L          Rotate right / left 90 deg (same as Cmd+Right / Cmd+Left)
  Cmd+Up / Cmd+Down      Select previous / next .fff in the list (loads that file's own preset)
  Cmd+Z / Shift+Cmd+Z    Dust undo / redo (100% window, brush on)
  Pinch / Cmd+scroll     Preview zoom
  Space + drag           Pan the preview (cursor becomes a hand)
  Shift+Arrows           Nudge the ROI (hold to accelerate)
  Arrows / Tab / Delete  Curve handle nudge / switch / delete (Ctrl+arrows = 10x step)
  Esc                    Step out of the active mode: curve node -> eyedropper -> ROI

9. Free vs paid
----------------------------------------------------------------------
  Free: full correction chain, preview, 100% view, 8-bit export (3x downsampled)
  Standard (paid): full resolution, 16-bit, batch export, .fff write-back, native dust
    removal, FlexBox scanner interaction
  Commercial: everything in Standard plus native FFF cropping/splitting (Cmd+Option+S)

  Without activation, paid items are greyed out (hover shows a not-activated hint).
  The top-bar licence status names the tier (Free / Standard / Commercial) and expiry.

10. FlexBox hardware (Standard tier and up)
----------------------------------------------------------------------
  The scanner 1394 cable plugs into the box, and the box joins your LAN; the app then
  discovers devices, sends commands and receives data.
  - FlexBox manager: Discover / refresh, add a manual IP; one row per scanner:
    Acquire / Release, Preview/capture, Lamp, Focus, Read-only identify... (acquire first)
  - Scanner preview / capture: holder / frame, resolution %, filename prefix, capture
    area, use local focus data, preset; preview never writes, capture writes
    <working folder>/<prefix>-NNN.fff
  - Commands that move mechanics raise an approval first (command / parameters / source /
    mechanical impact / fallback) -> Confirm and send
  - Focus data manager: Read device flash (read-only) -> Generate focus data -> Write
    device flash -> Restore original baseline. WARNING: sweep / write / restore all move
    mechanics; an _ORIG backup must exist before writing, and every action reconfirms.

11. FAQ
----------------------------------------------------------------------
  - Do I need to press "Render"? No, and there is no such button; changes apply instantly.
  - Histogram empty? Select a file and wait for it to load, or check whether the ROI sits
    on an all-black / all-white area.
  - ROI gone after switching files? By design: selections are not reused across files.
  - Export does not match the preview? Check the colour-management state and "Embed
    profile" first, then open the TIFF in colour-managed software; after changing
    monitors check that monitor profile in System Settings.
  - Does dust removal change my original file? Not unless you click "Write into FFF".

If you hit a problem, tell me the version number and build time shown in the window
title - those are the real version and build time of this package.